﻿{% extends "base.html" %}

{%block doc_js%}
$(document).ready(function(){
    $("#nav").append("<a href='/entry/{{entry.key.id}}' class='current'> {{entry.author.nickname}} 分享的图片#{{entry.key.id}}</a>");
})
{%endblock%}

{%block sub_nav%}        
{%endblock%}
{%block foot_nav%}        
{%endblock%}
{% block content %}        {% if entry %}
            <div class="yui-g rounded">
              <div class="yui-u first">      	        <div class="image_holder">
      	        <a href="/entry/{{ entry.key.id }}" title="">
                  <img class="image"  src="/image/{{ entry.image.key.id }}?w=550&h=600"/>
                </a>
                </div>
      	      </div>
              <div class="yui-u">
      	        <div class="entry">
				<div>
				    by <b>{% if entry.author.nickname %} 
				    <a href="/user/{{entry.author.key.id}}">{{entry.author.nickname}}</a>
				    {%else%}
				    "匿名人士"
				    {%endif%}
				    </b>
				at
                  {{ entry.date|timezone:8|date:"Y-m-d H:i:s" }}
                  </div>
                  <div>
                        
                    {%if entry.image_purl%}
      	        		来自 <a href="{{entry.image_purl}}">{{entry.image_purl}}</a>
      	        	{%else%}
      	        	    来源神秘
      	        	{%endif%}
      	            </div>
      	            <div>
                  {% if admin %}|&nbsp;<a href="/entry/del/{{ entry.key.id }}" onclick="return confirm('确定要删除吗?')">Delete</a>| <a href="/entry/edit/{{ entry.key.id }}">Edit</a>{% endif %}
                    </div>
                {%if entry.comment%}
                <div class="comment">{{ entry.comment|escape|linebreaks }}</div>
                {%endif%}
                </div>
                <div class="replies">
                    <div class="new_reply">                    {% if current_user %}
                        <a href="" onclick="$('#new_reply_form_{{entry.key.id}}').toggle(); $('#new_reply_form_{{entry.key.id}} textarea').focus(); return false;">>>我来说两句</a>
                    {% else %}
                        <a href="/login/">>>我来说两句</a>
                    {% endif %}
                        <div id="new_reply_form_{{entry.key.id}}" style="display: none;">
                          <form id="reply_form" action="/reply/new/?entry_id={{entry.key.id}}&redirect_to=/" enctype="multipart/form-data" method="post">
                            <div><textarea name="comment" rows="5"style="width: 100%;"></textarea></div>
                            <div><input type="submit" value="Submit" /></div>
                          </form>
                        </div>
                    </div>
                    {% if entry.replies %}
                      {% for reply in entry.replies %}
                            <div class="reply"><b>{{reply.author.nickname}}</b> 在{{reply.date|zh_timesince}}之前说:{{ reply.comment|escape|linebreaks }}</div>
                      {% endfor %}
                    {% endif %}
                    
                </div>
      	      </div>
            </div>
        {% endif %}
{% endblock %}



